import Layout from '../components/Layout/Layout'
import Login from '../views/Login/Login'
import Error from '../components/Error/Error'
import Home from '../views/Home/Home'
import RightMain from '../components/RightMain/RightMain'
import AuthResources from '../views/AuthResources/AuthResources'
import AuthRoles from '../views/AuthRoles/AuthRoles'
import AuthUser from '../views/AuthUser/AuthUser'

const routes = [
  {
    path: '/login',
    exact: false,
    meta: { permission: '' },
    component: Login
  },
  {
    path: '/404',
    exact: false,
    meta: { permission: '' },
    component: Error
  },
  {
    path: '/',
    exact: false,
    meta: { permission: '' },
    component: Layout,
    routeChildren: [
      {
        path: '/',
        exact: true,
        meta: { permission: '' },
        component: Home
      },
      {
        path: '/auth',
        exact: false,
        meta: { permission: 'auth' },
        component: RightMain,
        routeChildren: [
          {
            path: '/auth/resources',
            exact: false,
            meta: { permission: 'authResources' },
            component: AuthResources
          },
          {
            path: '/auth/roles',
            exact: false,
            meta: { permission: 'authRoles' },
            component: AuthRoles
          },
          {
            path: '/auth/users',
            exact: false,
            meta: { permission: 'authUser' },
            component: AuthUser
          }
        ]
      }
    ]
  }
]

export default routes
